package pdmtest.cl;

import java.net.URL;

import org.codehaus.xfire.client.Client;


public class XfireClient {

	public static void main(String[] args) {

		String xml = "<LIST>                                                    "+
				"	<COMPONENT>                                              "+
				"		<MATERIALCODE>2222</MATERIALCODE>                  "+
				"		<MATERIALTYPE/>                                        "+
				"		<CLASS1/>                                              "+
				"		<CLASS2/>                                              "+
				"		<MATERIALNAME>aaaaa</MATERIALNAME>                    "+
				"		<DESCRIPTION>bbb</DESCRIPTION>                    "+
				"		<STRN>技术标准号222</STRN>                                "+
				"		<UNIT/>                                                "+
				"		<QUALITYGRADE>质量等级22</QUALITYGRADE>                  "+
				"		<PACKAGETYPE>封装形式22</PACKAGETYPE>                    "+
				"		<SIZE>外形尺寸</SIZE>                                  "+
				"		<MANUFACTURER>厂家</MANUFACTURER>                      "+
				"		<XYLY>选用来源</XYLY>                                  "+
				"		<CHINAIMPORT/>                                         "+
				"		<YYFX>应用方向</YYFX>                                  "+
				"		<PRIMARYMETER>主要性能参数</PRIMARYMETER>              "+
				"		<PRODUCT>国内外主要对应产品</PRODUCT>                  "+
				"		<REPLACED>替代产品</REPLACED>                          "+
				"		<PINMATERAIL>引脚材料</PINMATERAIL>                    "+
				"		<TIPATTRIBUTE>标示属性</TIPATTRIBUTE>                  "+
				"		<ISSELECT>选用状态</ISSELECT>                          "+
				"		<PROVIDE>供货状态</PROVIDE>                            "+
				"		<PRICE>参考单价</PRICE>                                "+
				"		<COLOR>颜色</COLOR>                                    "+
				"		<STOCK>库存</STOCK>                                    "+
				"		<PROCURECIRCLE>采购周期</PROCURECIRCLE>                "+
				"		<REMARK>备注</REMARK>                                  "+
				"	</COMPONENT>                                             "+
				"</LIST>                                                   ";
		Client client = null;
		try {
			client = new Client(new URL("http://49.234.39.61:8081/drms/ws/dataServiceXml?wsdl"));
			Object[] retObject = client.invoke("acceptEditingDataOfXml", new Object[] {"COMPONENT",xml});
			String retValue = (String) retObject[0];
			System.out.println(retValue);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (client != null) {
				client.close();
			}
		}
	
	}
	
	
	
}
